package com.fc.happyteam.entity;


import com.fc.happyteam.utils.RRException;

/**
 * Created by futurecreative on 2017/8/14.
 */
public enum SkuPriceDuration {
    HOUR(1),
    HALF_DAY(12),
    DAY(24),
    WEEK(168),
    MONTH(720);

    private int hours;

    SkuPriceDuration(int hours){
        this.hours = hours;
    }

    public int getHours() {
        return hours;
    }

    public static SkuPriceDuration fromString(String value){
        for(SkuPriceDuration duration : SkuPriceDuration.values()){
            if(duration.toString().equalsIgnoreCase(value)){
                return duration;
            }
        }
        throw new RRException("SkuPriceDuration not supported.");
    }
}
